package cn.yuyiling.jelly.sr.mongodb.entity;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.io.Serializable;
import java.util.Date;

@Data
@NoArgsConstructor
@Document(collection = "user_learning_records")
public class UserLearningRecord implements Serializable {

    @Id
    private String id;

    private String userId;

    private String knowledgePointId;

    private Date startTime;

    private Date endTime;

    private RecordType type;

    private QuizResult quizResult;

    private Date createdAt;

    public enum RecordType {
        STUDY_KNOWLEDGE_POINT,
        ANSWER
    }

    @Data
    public static class QuizResult {
        private String answerId;
        private int score;
    }
}